import utils_index from '../../utils/index.js';
const regeneratorRuntime = utils_index.regeneratorRuntime
import {
  userModel
} from '../../apis/index.js'
Page({
  data: {
    list:[]
  },
  onLoad: function (options) {
    this.getDataList()
  },
  getDataList(){
    utils_index.showLoading()
    userModel.getRecommends().then(res=>{
      this.setData({
        list:res
      },()=>{
        utils_index.hideAll()
      })
    }).catch(()=>{
      utils_index.hideAll()
    })
  },
  openApp(e){
    let item = e.currentTarget.dataset.item
    utils_index.navigateToMiniProgram({
      appId:item.link_addr
    })
  }
})